package com.nondo.dean.order.model.param;

import java.util.List;

import javax.validation.constraints.NotNull;

import com.nondo.dean.order.model.param.ProductOrderParam;

public class PlatformOrderParam {
    private Integer userId; // 用户ID
    private String userName; // 客户名称
    private String moible; // 联系电话
    private String address; // 客户地址
    private String saleGuide; // 导购员
    private String contract; // 合同编号
    private String userType; // 客户等级
    private String deliveryUser; // 送货员
    private String note; // 备注

    private List<ProductOrderParam> productList;

    /**
     * @return the userId
     */
    @NotNull(message="经销商ID不能为空")
    public Integer getUserId() {
        return userId;
    }

    /**
     * @param userId the userId to set
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * @return the userName
     */
    @NotNull(message="收货人姓名不能为空")
    public String getUserName() {
        return userName;
    }

    /**
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * @return the moible
     */
    @NotNull(message="收货人手机号不能为空")
    public String getMoible() {
        return moible;
    }

    /**
     * @param moible the moible to set
     */
    public void setMoible(String moible) {
        this.moible = moible;
    }

    /**
     * @return the address
     */
    @NotNull(message="收货人地址不能为空")
    public String getAddress() {
        return address;
    }

    /**
     * @param address the address to set
     */
    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * @return the saleGuide
     */
    public String getSaleGuide() {
        return saleGuide;
    }

    /**
     * @param saleGuide the saleGuide to set
     */
    public void setSaleGuide(String saleGuide) {
        this.saleGuide = saleGuide;
    }

    /**
     * @return the contract
     */
    public String getContract() {
        return contract;
    }

    /**
     * @param contract the contract to set
     */
    public void setContract(String contract) {
        this.contract = contract;
    }

    /**
     * @return the userType
     */
    public String getUserType() {
        return userType;
    }

    /**
     * @param userType the userType to set
     */
    public void setUserType(String userType) {
        this.userType = userType;
    }

    /**
     * @return the deliveryUser
     */
    public String getDeliveryUser() {
        return deliveryUser;
    }

    /**
     * @param deliveryUser the deliveryUser to set
     */
    public void setDeliveryUser(String deliveryUser) {
        this.deliveryUser = deliveryUser;
    }

    /**
     * @return the note
     */
    public String getNote() {
        return note;
    }

    /**
     * @param note the note to set
     */
    public void setNote(String note) {
        this.note = note;
    }

    /**
     * @return the productList
     */
    public List<ProductOrderParam> getProductList() {
        return productList;
    }

    /**
     * @param productList the productList to set
     */
    public void setProductList(List<ProductOrderParam> productList) {
        this.productList = productList;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "PlatformOrderParam [userId=" + userId + ", userName=" + userName + ", moible=" + moible + ", address="
            + address + ", saleGuide=" + saleGuide + ", contract=" + contract + ", userType=" + userType
            + ", deliveryUser=" + deliveryUser + ", note=" + note + ", productList=" + productList + "]";
    }

    /**
     * 客户端输入参数校验
     * 
     * @param param {@link PlatformOrderParam}
     * @return 字符串 错误提示
     */
    public static String checkInputParam(PlatformOrderParam orderParam) {
        String message = null;
        List<ProductOrderParam> productList = orderParam.getProductList();
        if (productList == null) {
            message = "产品物料信息不能为空";
            return message;
        }
        return message;
    }

}
